{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">所属俱乐部：</label>
                            <div class="layui-input-block">
                                <select name="ma_club_id" xm-select="select2" lay-verify="required" xm-select-radio=""  xm-select-search="" xm-select-search-type="dl">
                                    {foreach name='club' item='vo'}
                                    <option value="{$vo.club_id}" {$vo.club_id == $apply.ma_club_id ? 'selected' : ''}>{$vo.club_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">领队：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ma_lingd" lay-verify="required" class="layui-input" placeholder="领队" value="{$apply.ma_lingd}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">教练：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ma_coach" lay-verify="required" class="layui-input" placeholder="教练" value="{$apply.ma_coach}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">组别：</label>
                            <div class="layui-input-block">
                                <select name="ma_group" xm-select="select1" lay-verify="required" xm-select-radio=""  xm-select-search="" xm-select-search-type="dl">
                                    {foreach name="group" item="v"}
                                    <option value="{$v.mag_group_id}" {$v.mag_group_id == $apply.ma_group ? 'selected' : ''}>{$v.mg_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">帆号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ma_fan_code" lay-verify="required" class="layui-input" placeholder="帆号" value="{$apply.ma_fan_code}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ma_boat_code" lay-verify="required" class="layui-input" placeholder="船号" value="{$apply.ma_boat_code}">
                            </div>
                        </div>

                        <input type="hidden" value="{$ma_id}" name="ma_id">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('memberEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('Matchmember/index')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            });
        });
    });
</script>

</body>
</html>
